<!-- 通用组件：下拉菜单 -->
<template>
    <div :id="id">
        <el-dropdown split-button type="primary" @click="handleClick">
            下拉菜单
            <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>黄金糕</el-dropdown-item>
                <el-dropdown-item>狮子头</el-dropdown-item>
                <el-dropdown-item>螺蛳粉</el-dropdown-item>
                <el-dropdown-item>双皮奶</el-dropdown-item>
                <el-dropdown-item>蚵仔煎</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
    </div>
</template>

<script>
    import register from '@/js/main/register.js';

    export default {
        props: {
            element: {
                type: Object
            },
            id: {
                type: String
            }
        },
        methods: {
            handleClick() {
                console.log('button click');
            }
        },
        created() {
            register.addComponent(this);
        },
        destroyed() {
            register.removeComponent(this);
        }
    }
</script>